package formBean;

import java.util.ArrayList;
import java.util.List;

import org.mybeans.form.FormBean;

public class RedirectForm extends FormBean{

	private String url;

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
			this.url = url;
	}
	
	public List<String> getValidationErrors() {
		List<String> errors = new ArrayList<String>();

		if (url == null || url.length() == 0) {
			errors.add("url is required");
		}else{
			if(url.contains("<") || url.contains(">") || url.contains("'") || url.contains("\"")){
				errors.add("invalid email format");
			}
		}
		return errors;
	}
}
